
<script lang="ts">
import { ref } from 'vue';
import { useRouter } from 'vue-router'


export default {
  setup() {
    const router = useRouter();
    let userids = ref("");
    function URL() {
      let urlid = userids.value;
     // alert(urlid);
     router.push({
                name:'user',
                params:{
                  userId:String(urlid),
                }
            })
    }
    return {
      userids,
      URL
    };
  }
}


</script>

<template>
  <div>
    <router-link to="/">页面跳转到首页</router-link>
    <router-link to="/User/ABC">传值跳转到User里</router-link>
    <input type="button" value="页面跳转" @click="URL()" />
    <input type="text" v-model="userids" />
    <router-view></router-view>
  </div>
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
